package com.dzl.voucherSecret.service;

import com.dzl.voucherSecret.pojo.WelfareVoucherSecret;
import com.dzl.base.service.BaseService;
import com.dzl.voucherSecret.pojo.query.VoucherSecretQuery;
import com.dzl.voucherSecret.pojo.vo.VoucherSecretVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 劵密信息表(WelfareVoucherSecret)表服务接口
 * @author caobucao
 * @date 2021-05-22 14:18:51
 */
public interface WelfareVoucherSecretService extends BaseService<WelfareVoucherSecret> {

    /**
     * 分页查询券密
     * @param query 查询条件
     * @return java.util.List<com.dzl.voucherSecret.pojo.vo.VoucherSecretVo>
     * @date 2021/5/24 9:37
     * @author caobucao
     */
    List<VoucherSecretVo> queryVoucherSecretPage(VoucherSecretQuery query);

    /**
     * 定时刷新过期券密的过期状态
     * @return java.lang.Integer
     * @date 2021/5/26 15:53
     * @author caobucao
     */
    Integer updateIsExpiredByExpiredTime();

    /**
     * 获取券密列表
     * @param idList 券密id
     * @return java.util.List<com.dzl.voucherSecret.pojo.WelfareVoucherSecret>
     * @author ChenLong
     * @date 2021-06-15 21:23:26
     **/
    List<WelfareVoucherSecret> getVoucherSecretListByIds(List<Integer> idList);

    /**
     * 获取指定张可用的券密
     * @param quantity 数量
     * @return java.util.List<com.dzl.voucherSecret.pojo.WelfareVoucherSecret>
     * @author ChenLong
     * @date 2021-06-15 21:48:26
     **/
    List<WelfareVoucherSecret> getVoucherSecretListLimitByQuantity(Integer quantity, Integer skuId);

    /**
     * 更新券密为出售
     * @param userId 用户id
     * @param idList 券密id列表
     * @return java.lang.Integer
     * @author ChenLong
     * @date 2021-06-15 21:48:30
     **/
    Integer updateVoucherSecretUsed(Integer userId, List<Integer> idList);

    /**
     * 订单详情查询券密
     * @date 2021/6/30 11:16
     * @author caobucao
     * @param query   查询条件
     * @return java.util.List<com.dzl.voucherSecret.pojo.vo.VoucherSecretVo>
     */
    List<VoucherSecretVo> queryOrderVoucherSecret(VoucherSecretQuery query);

    /**
     * 删除券密组下的所有未售出券密
     * @date 2021/9/18 13:57
     * @author caobucao
     * @param groupId 券密组id
     * @return java.lang.Integer
     */
    Integer deleteVoucherSecretByGroupId(Integer groupId);
}
